<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>  
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>


        <link rel="stylesheet" href="../scripts/timer/jquery.ui.timepicker.css" type="text/css" />

        <script type="text/javascript" src="../scripts/timer/jquery.ui.core.min.js"></script>    
        <script type="text/javascript" src="../scripts/timer/jquery.ui.timepicker.js"></script>
        <script type="text/javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
               $j('input#leavedate1,input#leavedate2').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                validateform("cus-input-form-charge");
                $j('#timepicker').timepicker();
                $j('#timepicker2').timepicker();
                // $j('.sumbitEmp').attr('disabled', true);
                //                $j("#leavedate2").live("change",function(){
                //                    var DateToValue = $j("#leavedate1").val();
                //                    var DateFromValue = $j("#leavedate2").val();
                //                
                //                    if (Date.parse(DateToValue) <= Date.parse(DateFromValue)) {
                //                       $j(".alert").text("");
                //                         $j('.sumbitEmp').attr('disabled', false);
                //                    }else{
                //                          $j('.sumbitEmp').attr('disabled', true);
                //                      $j(".alert").text("Xin vui long kiểm tra ngày tháng");
                //                    }
                //                });
            });
        </script>

        <style type="text/css">
            #ui-datepicker-div
            {
                z-index: 9999999;
            }
            #leavedate1{
                width:90px;
            }
            #leavedate2{
                width:90px;
            }

        </style>
    </head>
    <f:view>
        <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
        <a4j:form id="cus-input-form-charge">
            <body style=" float:left; width:auto; height:auto; margin:0px;">
                <div class="popup" style="height:470px; width:620px">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="#{locale.care_customer_person}"/></div>
                    </div>
                    <div class="popup-content">
                        <div class="main_content">
                            <div class="form_item_content" style="display: block;">



                                <div class="fields_input_title">
                                    <label><h:outputText value="#{locale.title}"/>*:</label>
                                    <h:inputText value="#{B630Bean.bv631}" id="title" styleClass="required">                                      
                                    </h:inputText>

                                </div>
                                <div class="fields_input">
                                    <label class="feild_sort"><h:outputText value="#{locale.purpose}"/>:</label>
                                    <h:selectOneMenu   value="#{B630Bean.fb670}">
                                        <f:selectItems value="#{B630Bean.listComB670}" />                                               
                                    </h:selectOneMenu>
                                </div>
                                <div class="edit_form_left">
                                    <div class="fields_input">                                       
                                        <label><h:outputText value="#{locale.start_date}" /> *:</label>&nbsp;
                                         <input  value="<h:outputText value="#{B630Bean.bd632}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>" type="text" id="leavedate1" name="leavedate1" class="dateStart1 input_fields date"  />
                                               <input type="text" style="width: 58px;" id="timepicker" value="" name="timepicker" />
                                        </div>
                                        <div class="fields_input">                                       
                                            <label><h:outputText value="#{locale.end_date}" /> *:</label>&nbsp;
                                        <input value="<h:outputText value="#{B630Bean.bd633}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>" type="text" id="leavedate2" name="leavedate2" class="dateEnd1 input_fields date" />
                                        
                                               <input type="text" style="width: 58px;" id="timepicker2" name="timepicker2" value="" />
                                        </div>
                                        <div class="fields_input">
                                            <label class="feild_long"> <h:outputText value="#{locale.finish}" /> *:</label>
                                        <h:selectOneRadio value="#{B630Bean.fc500}" styleClass="feild_sex"    >
                                            <f:selectItem itemValue="10" itemLabel="Yes" />
                                            <f:selectItem itemValue="1" itemLabel="No"/>                                                     
                                        </h:selectOneRadio>
                                    </div>

                                </div>

                                <div class="edit_form_right">
                                    <div class="fields_input">
                                        <label class="feild_long">
                                            <h:outputText value="#{locale.person_representative}" />:</label>
                                            <h:selectOneMenu value="#{B630Bean.fq100}"  >        
                                                <f:selectItem itemLabel="Xin vui lòng chọn" itemValue="0"/>
                                                <f:selectItems value="#{B630Bean.selectComN100D}" />                                            
                                            </h:selectOneMenu>
                                    </div> 
                                    <div class="fields_input">
                                        <label class="feild_long"><h:outputText value="#{locale.project}" />:</label>
                                        <h:selectOneMenu value="#{B630Bean.fb050}"  >                                           
                                            <f:selectItems value="#{B630Bean.combB050}" />
                                        </h:selectOneMenu>
                                    </div>
                                </div>
                                <div class="fields_input">
                                    <label class="feild_sort"><h:outputText value="#{locale.description}" />:</label>
                                    <h:inputTextarea value="#{B630Bean.bc637}" style="width:468px;height:85px;margin-left:0px"/>    
                                </div> 

                                <div class="fields_input">
                                    <label class="feild_sort"><h:outputText value="#{locale.key}" />:</label>
                                    <h:inputText value="#{B630Bean.bv636}"/>    
                                </div> 
                                <div class="bg_departments">
                                    <div class="edit_form_left">

                                        <div class="fields_input">
                                            <label class="feild_sort" style="margin-left: 9px;"><h:outputText value="#{locale.department}"/>:</label>
                                            <h:selectOneMenu style="width:150px;"  id="cmbNv113" value="#{B630Bean.fn850dt}"  valueChangeListener="#{B630Bean.changeCombN850forN900}">
                                                <f:selectItems value="#{B630Bean.selectCombN850}" />
                                                <a4j:support event="onchange" reRender="nv112" />
                                            </h:selectOneMenu>
                                        </div>
                                    </div>
                                    <div class="edit_form_right">
                                        <div class="fields_input">
                                            <label style="width:125px;"><h:outputText value="#{locale.emp_intro}"/>:</label>&nbsp;
                                            <h:selectOneMenu id="nv112" style="width:150px;" value="#{B630Bean.fn100}">
                                                <f:selectItems value="#{B630Bean.selectItemN900}"></f:selectItems>
                                            </h:selectOneMenu>
                                        </div>
                                    </div>
                                    <div class="alert"></div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="popup-footer">

                        <div class="buttonsave" style="margin-right: 44px;" onclick="jQuery.fancybox.close()"><span><h:outputText value="#{locale.close}"/></span></div>
                        <h:commandButton onclick="return validatecheck('cus-input-form-charge');"   action="#{B630Bean.updateByB630}" styleClass="buttonsave sumbitEmp" value="#{locale.save}">
                            <f:param value="#{B630Bean.fk100}" name="itemid"/>
                            <f:param value="#{B630Bean.pageRidiect}" name="page"/>
                        </h:commandButton>
                        <h:inputHidden value="#{B630Bean.fk100}" id="itemid"/>
                        <h:inputHidden value="#{B630Bean.fk100}" id="fk100"/>
                        <h:inputHidden value="#{B630Bean.pb630}" id="pb630"/>
                        <h:inputHidden value="#{B630Bean.pageRidiect}" id="pageRidiect"/>

                    </div>
                </div>
            </body>
        </a4j:form>
    </f:view>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
    });
</script>